package service;

import Util.SqlSessionUtil;
import dao.NingboGuaranteeMapper;
import domain.NingboGuarantee;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class NingboGuaranteeService {
    public List<NingboGuarantee> selectByYear(Integer year) {
        SqlSession session = SqlSessionUtil.getSession().openSession();
        NingboGuaranteeMapper operation = session
                .getMapper(NingboGuaranteeMapper.class);
        List<NingboGuarantee> nbList = operation.selectByYear(year);
        session.commit();
        session.close();
        return nbList;
    }

    public static void main(String[] args) {
        NingboGuaranteeService z = new NingboGuaranteeService();
        System.out.println(z.selectByYear(2016));
    }
}
